<?php $this->_extends('_layouts/default_layout'); ?>

<?php $this->_block('contents'); ?>

<div class="tabs_title clearfix">
  <h3>项目管理</h3>
  
<?php
$this->_control('Admin_SmallTabs', 'small_tabs', array(
	'menu' => '项目管理', 'current' => '搜索结果'
));
?>
  
</div>

<div class="block tips">
  <h3>共搜索到 <?php echo count($projects); ?> 个项目</h3>
</div>

<form class="adminform" name="deleteform" method="post" action="<?php echo url('projects/update'); ?>">
  <table>
    <tr>
      <th></th>
      <th>项目名称</th>
      <th>标题</th>
      <th>所属分类</th>
      <th>创建人</th>
      <th>状态</th>
      <th>创建日期</th>
      <th>&nbsp;</th>
    </tr>

<?php foreach ($projects as $project): ?>

	<tr>
      <td><input class="checkbox" type="checkbox" name="delete[]" value="<?php echo $project->id(); ?>" /></td>
      <td><a href="<?php echo url('projects/edit', array('id' => $project->id())); ?>"><?php echo h($project->name); ?></a></td>
      <td><a href="<?php echo url('projects/edit', array('id' => $project->id())); ?>"><?php echo h($project->title); ?></a></td>
	  <td><?php echo h($project->category); ?></td>
      <td><?php echo h($project->owner); ?></td>
	  <td><?php echo $project->status_signature_html; ?></td>
	  <td><?php echo date('Y-m-d H:i', $project->created); ?></td>
      <td nowrap="nowrap">
        <a href="<?php echo url('projects/edit', array('id' => $project->id())); ?>">管理</a>
        <a href="<?php echo url('#::projects/show', array('name' => $project->name)); ?>" target="_blank">预览</a>
      </td>
    </tr>

<?php endforeach; ?>

	<tr class="nobg">
	  <td>
	    <input type="checkbox" name="chkall" id="chkall" class="checkbox" onclick="$('input[name=\'delete[]\']').attr('checked', this.checked);" />
	    <label for="chkall">删?</label>
	  </td>
	  <td colspan="7">
	    <input type="submit" class="btn" name="btnsubmit" value="提交"  />
		&nbsp;&nbsp;&nbsp;
		<a href="<?php echo url('projects/index'); ?>">重新搜索</a>
	  </td>
	</tr>
  </table>
</form>

<?php $this->_endblock(); ?>
